<?php

if(!empty($_POST)){
	if($_POST['password']!=$_POST['cpassword']){

		echo '<script> alert ("原密码与验证的密码不相符");history.go(-1);</script>';die;
	}

	$_POST['password']=md5($_POST['password']);

    unset($_POST['cpassword']);

	$rows = add('menber',$_POST);

	

	if ($rows>0) {

		include(LIB_PATH.'sen_mail.php');
		
		sen_email($_POST['email']);
		
    echo '<script> alert ("注册成功，请到邮箱中激活您的账号");location.href="index.php?c=index&a=index";</script>';die;
       
}else{

    echo '<script> alert ("注册失败");history.go(-1);</script>';
        die;
}
}




// print_r($_SESSION);die;

// include ('protected/view/home/index/index.html');

// print_r(VIEW_PATH);die;
include (VIEW_PATH.$admin.'layout.html');
?>

